#pragma once

#include <map>
#include <list>
#include <string>

// EFFECT TYPES
#define EFFECT_PAN		1
#define EFFECT_GAIN		2
#define EFFECT_DIST		3
#define EFFECT_REVERB	4

namespace sndcore
{
	class Channel;
}

namespace Audio
{
	// TYPEDEFS
	typedef std::map<VariableHandle,class Variable*>		variablemap_t;
	typedef std::pair<VariableHandle,class Variable*>		variablepair_t;
	typedef std::map<GraphHandle,class Graph*>				graphmap_t;
	typedef std::pair<GraphHandle,class Graph*>				graphpair_t;
	typedef std::map<std::string,unsigned>					handlemap_t;		//!< map sorted by strings that stores corresponding IDs
	typedef std::pair<std::string,unsigned>					handlepair_t;
	typedef std::list<class Event*>							eventlist_t;
	typedef std::list<struct Effect*>						effectlist_t;
	typedef std::list<class SubEvent*>						subeventlist_t;
	typedef std::pair<float,class SubEvent*>				subeventpair_t;
	typedef std::list<subeventpair_t>						subeventqueue_t;	//!< Pairs of trigger times and sub-events
	typedef std::map<XMLFileHandle,class XMLAudioData*>		xmldatamap_t;
	typedef std::pair<XMLFileHandle,class XMLAudioData*>	xmldatapair_t;
	typedef std::map<EventHandle,struct EventData*>			eventdatamap_t;
	typedef std::pair<EventHandle,struct EventData*>		eventdatapair_t;
	typedef std::map<SubEventHandle,struct SubEventData*>	subeventdatamap_t;
	typedef std::pair<SubEventHandle,struct SubEventData*>	subeventdatapair_t;
	typedef std::map<unsigned,struct EffectData*>			effectdatamap_t;
	typedef std::pair<unsigned,struct EffectData*>			effectdatapair_t;
	typedef std::map<FileHandle,struct AudioFile*>			audiofilemap_t;
	typedef std::pair<FileHandle,struct AudioFile*>			audiofilepair_t;
	typedef void (*effectfunc_t)(float,sndcore::Channel*);						//!< Function ptr for altering a channel

	struct AudioFile
	{
		AudioFile(std::string name, std::string file) : m_name(name), m_filename(file) {}
		std::string		m_name;
		std::string		m_filename;
	};

	struct EventData
	///////////////////////////////////////////////////////////////////////////////
	// Description: Not an actual event, just the data need to create one
	//
	// Recent Changes:
	// -brasmuss 4/10/2007 : Created
	///////////////////////////////////////////////////////////////////////////////
	{
		EventData(std::string name, bool looping) : m_name(name), m_looping(looping) {}
		std::string			m_name;
		bool				m_looping;
		subeventdatamap_t	m_subEvents;
	};

	struct SubEventData
	{
		SubEventData(std::string sound, float trigger, int pitchShift, bool streaming) : m_soundName(sound), m_trigger(trigger), m_pitchShift(pitchShift), m_streaming(streaming)  {}
		float				m_trigger;
		std::string			m_soundName;
		int					m_pitchShift;
		bool				m_streaming;
		effectdatamap_t		m_effects;
	};

	struct EffectData
	{
		EffectData(std::string graph, std::string var, unsigned type) : m_graph(graph), m_variable(var), m_type(type) {}
		unsigned		m_type;
		std::string		m_graph;
		std::string		m_variable;
	};
}